﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RJ.Objects.GameEngine
{
    public abstract class GameView : GameObject
    {
        protected GameState gameState;
        protected List<GameObject> GameObjects;
        protected bool _isPaused;

        public GameView(GameState gameState)
        {
            this.gameState = gameState;
            GameObjects = new List<GameObject>();
        }

        public abstract void Initialize();

        public abstract void ConsumeMouseEvent();

        public abstract void ConsumeKeyboardEvent();

        public override void Update(double gameTime, double elapsedTime)
        {
            foreach (var gameObject in GameObjects)
                gameObject.Update(gameTime, elapsedTime);
        }

        public override void Draw(System.Drawing.Graphics g)
        {
            foreach (var gameObject in GameObjects)
                gameObject.Draw(g);
        }

        public void Pause()
        {
            _isPaused = !_isPaused;
        }
    }
}
